<?xml version="1.0"?>
<antlib>

	<macrodef name="py2sis">
		<attribute name="src" />
		<element name="args" optional="true" description="Arguments to ensymble" />
		<element name="options" optional="true" description="Options for ensymble" />
		<sequential>
			<py-run dir="${pys60.home}" python="${python.exec}" script="${pys60.home}/ensymble.py">
				<arg value="py2sis" />
				<options />
				<arg value="@{src}" />
				<args />
			</py-run>
		</sequential>
	</macrodef>

	<macrodef name="upload">
		<attribute name="host" />
		<attribute name="src" />
		<attribute name="dst" />
		<sequential>
			<py-run dir="${rpyc.scripts.dir}" script="${rpyc.scripts.dir}/s60ctl.py" pythonpath="${src.dir}" optimize="0">
				<arg value="copy" />
				<arg value="@{host}" />
				<arg value="@{src}" />
				<arg value="@{host}#@{dst}" />
			</py-run>
		</sequential>
	</macrodef>

	<macrodef name="upload-emu">
		<attribute name="root" />
		<attribute name="src" />
		<sequential>
			<copy file="@{src}" todir="@{root}epoc32/winscw/c/private/F020151B" />
		</sequential>
	</macrodef>


	<macrodef name="upload-script">
		<attribute name="host" />
		<attribute name="src" />
		<attribute name="drive" />
		<sequential>
			<py-run dir="${rpyc.scripts.dir}" script="${rpyc.scripts.dir}/s60ctl.py" pythonpath="${src.dir}" optimize="0">
				<arg value="copy" />
				<arg value="@{host}" />
				<arg value="@{src}" />
				<arg value="@{host}#@{drive}\data\python" />
			</py-run>
		</sequential>
	</macrodef>

	<macrodef name="upload-script-emu">
		<attribute name="root" />
		<attribute name="src" />
		<sequential>
			<copy file="@{src}" tofile="@{root}epoc32/winscw/c/Data/python/default.py" />
		</sequential>
	</macrodef>

	<macrodef name="upload-lib-emu">
		<attribute name="root" />
		<attribute name="src" />
		<sequential>
			<basename property="base.@{src}" file="@{src}" />
			<copy todir="@{root}epoc32/winscw/c/data/python/lib/${base.@{src}}/">
				<fileset dir="@{src}" />
			</copy>
		</sequential>
	</macrodef>


	<macrodef name="genuid">
		<attribute name="name" />
		<attribute name="property" />
		<sequential>
			<exec executable="python" outputproperty="@{property}" dir="${rpyc.scripts.dir}">
				<arg value="${rpyc.scripts.dir}/s60ctl.py" />
				<arg value="genuid" />
				<arg value="@{name}" />
			</exec>
		</sequential>
	</macrodef>

	<macrodef name="run">
		<attribute name="host" />
		<attribute name="exec" />
		<sequential>
			<py-run dir="${rpyc.scripts.dir}" script="${rpyc.scripts.dir}/s60ctl.py" pythonpath="${src.dir}" optimize="0">
				<arg value="run" />
				<arg value="@{host}" />
				<arg value="@{exec}" />
			</py-run>
		</sequential>
	</macrodef>

	<macrodef name="install">
		<attribute name="host" />
		<attribute name="path" />
		<sequential>
			<py-run dir="${rpyc.scripts.dir}" script="${rpyc.scripts.dir}/s60ctl.py" pythonpath="${src.dir}" optimize="0">
				<arg value="install" />
				<arg value="@{host}" />
				<arg value="@{path}" />
			</py-run>
		</sequential>
	</macrodef>


	<macrodef name="run-script">
		<attribute name="host" />
		<attribute name="drive" />
		<attribute name="name" />
		<sequential>
			<py-run dir="${rpyc.scripts.dir}" script="${rpyc.scripts.dir}/s60ctl.py" pythonpath="${src.dir}" optimize="0">
				<arg value="run-script" />
				<arg value="@{host}" />
				<arg value="@{drive}\data\python\@{name}" />
			</py-run>
		</sequential>
	</macrodef>


</antlib>
